home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 272_01 / keyboard.doc < prev    next >
Text File  |  1987-08-12  |  2KB  |  55 lines

  1.  
  2.  
  3.         NAME
  4.                 keyboard functions
  5.  
  6.         SYNOPSIS
  7.                 r = _kbstate();
  8.                 r = kbstatus(i);
  9.                 setcaps();
  10.                 clrcaps();
  11.                 setnumlock();
  12.                 clrnumlock();
  13.                 int r;    response
  14.                 int i;    which key status to return
  15.  
  16.  
  17.         DESCRIPTION
  18.         These functions all manipulate the keyboardf status flags
  19.         at 0000:417 and 0000:418.  _kbstate() returns the flags
  20.         in a strict binary format as they appear in memory, with
  21.         :417 in the low byte and :418 in the high byte.
  22.         kbstatus(i) takes a value (fro the list below) and returns
  23.         a TRUE or FALSE condition for the selected key state.
  24.         setcaps() will force the caps lock flag ON, and clrcaps
  25.         will force it off.  Similarly, setnumlock() and clrnumlock()
  26.         will work on the num lock flag.
  27.         For kbstatus the arguments are:
  28.              0 = return status of shift key(s)
  29.              1 = return insert state
  30.              2 = return caps lock state
  31.              3 = return num lock state
  32.              4 = return scroll lock state
  33.              5 = return <alt> state
  34.              6 = return <ctrl> state
  35.  
  36.  
  37.  
  38.         EXAMPLE
  39.             setcaps();
  40.             if(kbstate(2)) puts("Caps lock is now set");
  41.             else puts("Caps lock is NOT set");
  42.             clrcaps();
  43.             puts("Caps lock should now be off");
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.         This function is found in SMDLx.LIB for the Datalight Compiler.
  55.